<?php
error_reporting(E_ERROR);
$url = 'http://rogovdata.cloudapp.net:8080/v1/RoGovOpenData/Posturi?$select=angajator,entityid,latitudine,longitudine&format=json';
 
 
  $ch = curl_init();
  $timeout = 5;
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  $data = curl_exec($ch);
  curl_close($ch);
 
  $data_array = json_decode($data,true);
  foreach($data_array[d] as $linie)
        $return[] =  array($linie[angajator],
						   $linie[entityid],
						   $linie[latitudine],
						   $linie[longitudine]);
 
        echo json_encode($return);
       
        ?>